package com.zyit.service;

import com.zyit.service.Impl.ClassifyServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/myDelectClassify")
public class MyDelectClassifyService extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        ClassifyService service = new ClassifyServiceImpl();


        try {
            int i = service.DeleteClassify(id);

            if (i == 1) {
                resp.getWriter().write("true");
            } else {
                resp.getWriter().write("true");
            }


        } catch (Exception e) {
            throw new RuntimeException(e);
        }


    }
}
